package game.ouroboros;

import framework.DynamicGameObject;
import game.ouroboros.enemy.*;
import game.ouroboros.traps.*;

public class Projectile extends DynamicGameObject {

	protected Enemy enemy;
	protected double vel;
	protected boolean setVisible;
	public int type;
	public int damage;

	public Projectile(Trap t, Enemy e) {
		super(t.position.x, t.position.y, t.bounds.width / 5,
				t.bounds.height / 5);
		this.enemy = e;
		setVisible = true;
		this.type = t.getType();
		vel = 20;
	}

	public boolean inCollisionRange(Enemy e) {
		setVisible = false;
		return false;
	}

	public void update(float f) {
		double x = this.position.x - enemy.position.x;
		double y = this.position.y - enemy.position.y;
		double hipotenusa = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
		this.position.x -= vel * x / hipotenusa;
		this.position.y -= vel * y / hipotenusa;
	}

	public int getDamage() {
		return damage;
	}

	public int getType() {
		return type;
	}

	public boolean isAlive() {
		// TODO Auto-generated method stub
		return false;
	}
}
